package com.cencat.common.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Swagger配置类
 * 统一管理API文档配置
 * 
 * @author cencat
 * @version 1.0
 * @since 2024-12-19
 */
@Configuration
public class SwaggerConfig {

    /**
     * 创建OpenAPI配置
     * 
     * @return OpenAPI配置对象
     */
    @Bean
    public OpenAPI createRestApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("CenCat SaaS平台API文档")
                        .description("基于Spring Boot 3.x + Vue 3的智能出行SaaS平台")
                        .version("v1.0.0")
                        .contact(new Contact()
                                .name("cencat")
                                .email("cencat@example.com")
                                .url("https://github.com/cencat"))
                        .license(new License()
                                .name("Apache 2.0")
                                .url("https://www.apache.org/licenses/LICENSE-2.0")));
    }
}